package com.engine.cn.mq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @Autowired
    private MessageProducer messageProducer;

    @GetMapping("/send")
        public String sendMessage(@RequestParam String msg) {
        messageProducer.sendMessage(msg);
        return "消息已发送: " + msg;
    }
}
